/**
 * Copyright c FOUNDER CORPORATION 2006 All Rights Reserved.
 * FounderException.java
 */
package com.iori.common.exception;

import com.iori.common.util.PropertiesUtil;

/**
 * [クラス名]<br>
 * アプリケーションエラー<br>
 * <br>
 * [機能概要]<br>
 * ぴあシステムに、アプリケーションエラークラス。<br>
 * <br>
 * [変更履歴]<br>
 * 2006/09/13 ver1.00 新規作成 zhanjc<br>
 *
 * @author zhanjc
 * @version 1.00
 */
public class FounderException extends Exception {

	private static final long serialVersionUID = -1644716413196663818L;

	private int errorCode = -1; // 異常情報のタイプを記録し、ExceptionConfで値を取得する。

	public FounderException() {
		super();
	}

	public FounderException(String msgId) {
		super(PropertiesUtil.getMessage(msgId));
	}

	public FounderException(Exception e) {
		super(e);
	}

	public FounderException(Throwable cause) {
		super(cause);
	}

	public FounderException(FounderException e) {
		super(e);
		this.errorCode = e.errorCode;
	}

	public FounderException(String message, Exception e) {
		super(message, e);
	}

	public FounderException(Exception e, int errorCode) {
		super(e);
		this.errorCode = errorCode;

	}

	public FounderException(String message, int errorCode) {
		super(message);
		this.errorCode = errorCode;
	}

	protected void setErrorCode(int _errorCode) {
		this.errorCode = _errorCode;
	}

	public int getErrorCode() {
		return errorCode;
	}

	@Override
	public String toString() {
		return this.getClass().getName() + " error:" + errorCode;
	}
}
